package 简单.对称二叉树;
//递归
public class Solution1 {

    public boolean isSymmetric(TreeNode root){

        return checkTree(root,root);
    }

    public boolean checkTree(TreeNode p ,TreeNode q) {
        if(p== null && q==null){
            return true;
        }
        if(p  == null || q == null){
            return false;
        }
        return p.val == q.val && checkTree(p.right,q.left) && checkTree(p.left,q.right);

    }

}
